/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cz.muni.fi.heathrow.dao;

import cz.muni.fi.heathrow.entities.Steward;
import java.util.List;

/**
 *
 * @author Martin Žák
 */
public interface StewardDAO
{
    /**
     * gets Steward by its id
     * @param id
     * @throws IllegalArgumentException when argument null
     * @return Steward or NULL when not found
     */
    Steward get(Long id);
    
    /**
     * Persists steward
     * @throws ArgumentException when steward is already persisted
     * @throws IllegalArgumentException when argument null
     * @param steward 
     */
    void create(Steward steward);

    /**
     * Updates steward
     * @throws ArgumentException when steward is not persisted
     * @throws IllegalArgumentException when argument null
     * @param steward 
     */
    void update(Steward steward);

    /**
     * Removes persisted steward
     * @throws ArgumentException when steward is not persisted
     * @throws IllegalArgumentException when argument null
     * @param steward 
     */
    void remove(Steward steward);

    /**
     * Retrieves all stewards from source
     * @return 
     */
    List<Steward> findAll();

    /**
     * Retrieve steward by its Personal ID
     * @param personalId
     * @return 
     */
    Steward findByPersonalId(Long personalId);

    /**
     * Retrieves all stewards whose names corespond to anyName
     * @param anyName
     * @throws IllegalArgumentException when argument null
     * @return 
     */
    List<Steward> findByAnyName(String anyName, int limit);
}
